$(function () {
    $('#search').on('keyup', function () {
        if (event.keyCode === 13) {          
                axios.get('https://autumnfish.cn/search', {
                    params: {
                        keywords: $('#search').val()
                    }
                }).then(res=>{
                    console.log(res)
                    if(res.data.code===200){
                        console.log(res.data.result.songs)

                        var resHtml = ''
                        res.data.result.songs.forEach(function(item){
                            resHtml += `
                            <tr>
                                <td></td>
                                <td>${item.name}</td>
                            </tr>
                            `
                        })
                        $('.songs tbody').html(resHtml)
                    }else{
                        console.log('没有数据')
                    }
                })     
        }
    })

})  
